package com.weizai.carshop.controller;


import com.weizai.carshop.common.result.ResponseResult;
import com.weizai.carshop.service.AppUserService;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class AppUserController {

    private final AppUserService appUserService;

    /*
     * 登录接口
     * */
    @GetMapping("/login")
    public ResponseResult login(String username, String password) {
        ResponseResult result = appUserService.login(username, password);
        return result;
    }

    /*
    * 收藏
    * */
    @GetMapping("/collect")
    public ResponseResult collect(Long collectId,Long userId) {
        String result = appUserService.updateCollect(collectId,userId);
        return ResponseResult.okResult(result);
    }
}
